import { GBox } from "../../../../com/mui/containers/GBox";
import { GBoxDirection } from "../../../../com/mui/containers/globalVariable/GBoxDirection";
import { UICompomentPool } from "../../../../com/mui/utils/UICompomentPool";
import { StarItem } from "./StarItem";
import { EventName } from "../../mvc/EventName";
import { TransportReward } from "../../rules/TransportReward";
import { CycleTaskReward } from "../../rules/CycleTaskReward";
type int = number;
//class StarPanel
    
    export  class StarPanel extends GBox
    {
        constructor()
        {
            super();
            mouseChildren = false;
            mouseEnabled = false;
            direction = GBoxDirection.VERTICAL;
            return;
        }

        public updateData(arg1: int, arg2: string, arg3: int, arg4: int): void
        {
            var loc2=null;
            var loc3=0;
            var loc4=0;
            disposeChild();
            var loc1=1;
            while (loc1 <= arg1) 
            {
                (loc2 = UICompomentPool.getUICompoment(StarItem) as StarItem).createDisposedChildren();
                var loc5=arg2;
                switch (loc5) 
                {
                    case EventName.TransportMoveAward:
                    {
                        loc3 = TransportReward.getTransportReward(loc1, arg3, arg4);
                        loc2.updateData(loc1, loc3, loc4);
                        break;
                    }
                    case EventName.CycleTaskMoveAward:
                    {
                        loc2.updateData(loc1, CycleTaskReward.getReward(loc1, arg3));
                        break;
                    }
                }
                addChild(loc2);
                ++loc1;
            }
            this.invalidate();
            return;
        }

        public /* override */ dispose(arg1: Boolean=true): void
        {
            super.dispose(arg1);
            return;
        }
    }
